//---------------------------------------------------------------------------
#ifndef uBDETableOpH
#define uBDETableOpH

#include <BDE.hpp> //Pour CRTblDesc
#include "CtrlDB.h"
//---------------------------------------------------------------------------

namespace BDETableOperation
{
//ATTENTION Les variables suivantes doivent être désallouées par la fonction appelante :
// tbldesc->pfldDesc[], tbldesc->pecrFldOp[], ppvchkDescs[]
extern PACKAGE_CTRLDB void __fastcall GetBDEDescs(const AnsiString &aFileName,
                                                  hDBIDb*    hdb,
                                                  CRTblDesc* tbldesc,
                                                  CURProps*  PropsTbl = NULL ,
                                                  VCHKDesc** ppvchkDescs = NULL);

extern PACKAGE_CTRLDB DWORD __fastcall ConvertTFieldTypeToefldPDXType (TFieldType Type);
extern PACKAGE_CTRLDB short __fastcall Convert_fldPDXTofld(short TypePDX);

extern PACKAGE_CTRLDB void __fastcall InsertField(short shPosInsertion,
                                                  char szFieldName[],
                                                  short shTypeFieldParadox,
                                                  unsigned short ushMaxStringLen, // Ignoré si shTypeFieldParadox != fldPDXCHAR
                                                  bool           bObligatoire  ,
                                                  const AnsiString &aDefaultValue,
                                                  CRTblDesc *tblDesc);

extern PACKAGE_CTRLDB void __fastcall DeleteField(char *szFieldName, CRTblDesc *tblDesc);

extern PACKAGE_CTRLDB bool __fastcall FieldExist(const char *szFieldName, const CRTblDesc &tblDesc);

extern PACKAGE_CTRLDB void __fastcall ChangeFieldType(const char *szFieldName,
                                                      Word           efldPDXType,   // Une valeur fldPDX* restreinte
                                                      unsigned short ushMaxDataLen,
                                                      CRTblDesc *tblDesc);

extern PACKAGE_CTRLDB void __fastcall RenameField(char *szNomsource, char *szNomCible, CRTblDesc *tblDesc);

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// PackTable : Permet de recompresser une table
//             (util lorsque de gros enregistrements ont été supprimés)
//             (A effectuer sur une table fermée)                             //
////////////////////////////////////////////////////////////////////////////////
extern PACKAGE_CTRLDB bool PackTable (const AnsiString &RepTable, const AnsiString &NomTable);

} // namespace BDETableOperation

using namespace BDETableOperation;

#endif
